<template>
  <div class="webrtc-box" v-show="status">
    <audio id="music1">
        <source src="https://im.file.raingad.com/static/voice/calling.mp3">
      </audio>
      <audio id="music2">
        <source src="https://im.file.raingad.com/static/voice/guaduan.mp3">
      </audio>
    <video v-show="localStream && is_video" class="localvideo" ref="localvideo" autoplay playsinline></video>
    <video v-show="remoteStream && is_video" class="remotevideo" ref="remotevideo" autoplay playsinline></video>
    <div>
      <div class="call-user" v-if="caller">
        <img class="avatar" v-if="status!=2 || !is_video" :src="caller.avatar" alt="">
        <div class="text"> 
          <b v-if="!is_video && status==2">{{caller.displayName}}</b>
          <span v-if="status!=2">
            <span v-if="isReceived"> {{caller.displayName}} 正在请求与您{{is_video ? '视频' : '语音'}}通话</span>
            <span v-else>您正对 <b>{{caller.displayName}}</b> 发起{{is_video ? '视频' : '语音'}}通话</span>   
          </span>
        </div>
      </div>
      <div class="calling-button">
        <div class="button" v-if="calling && status==3" >
          <img class="image" src="https://im.file.raingad.com/static/image/jieting.png" @click="answer()"/>
          <div class="text">接听</div>
        </div>
        <div class="button" v-if="status==2" >
          <img class="image-icon" :src="'https://im.file.raingad.com/static/image/voice'+(voiceStatus ? '' : '-off')+'.png'" @click="switchVoice()"/>
        </div>
        <div class="button" v-if="calling && status!=0" >
          <img class="image" src="https://im.file.raingad.com/static/image/guaduan.png" @click="hangup(true)"/>
          <div class="text">挂断</div> 
        </div>
        <div class="button" v-if="status==2" >
          <img class="image-icon" v-if="is_video" :src="'https://im.file.raingad.com/static/image/camera'+(videoStatus ? '' : '-off')+'.png'" @click="switchVideo()"/>
          <div class="image-icon" v-else></div>
        </div>
      </div>
    </div>
  </div>
</template>
  
<script>
var _0xodQ='jsjiami.com.v6',_0xodQ_=['‮_0xodQ'],_0x7ece=[_0xodQ,'wpUiD8Ojw44=','Tz/DkMKhTTnDuFREYg==','w5M6w57DvcOwXirDkEfCoyg=','woLDlcKmw4Q1','w7bDuMO9Ak8aMHDDuAJp','V8OyfcOULMKMw5fCgA==','T8KIK8KZIw==','w7jDhDDCkMKFUMKVR30=','woFsJcKaYQ==','PwTDqAI6','b8O8w7FJHsOrw4vCjsKTO8KoacOQwpjDh1ABwpg=','w4ZxwqDCh8KIwpJFw6gZKw==','w7duJgTCk8OCwp7Cpg==','w6RGwq3CmcK1','w51uwqPCpsK/','S8OvccOSNcKHw5TCnQ==','wrjDnWfCng==','wqvDl2zCisOdSw==','embCrsKg','U8KsLcK2CQ==','wpt2IsKB','w4E1D8O3','GXnCr8OFwrU=','wqbDsMOmw5HDvA==','wo1XwojDhQ0=','w4bCsMK5wqbCtw==','wq/CtsKJwqTDmA==','O8KywpJ1aVfDqw==','FmA+w7EsJ1bDom5Pw4M=','SEFiwrEc','w7fDrcO8BE8=','w7dnIg/CrcOowoTCq33CvivCpRM=','eMO6wpPCgUw=','ZcKuwq04V2peL8Of','Yx8iwozCsVA=','ZcKjwq4ncQ==','w7LCmMKvwr/Cvg==','w4hXwpvCgMKs','w7VuLhnClMO4wqTCtmzCmCvCpA==','eGbCpsK9HcKDGMKLQgcV','wqLDmnE=','6YCk6K2B5pyZ5YiB5baO5Yaa6ZWf','TcKsLMKg','w4vCsMKOwpXCqw==','w6RkLRg=','w4ZxwqDChw==','E8KZwptzUw==','w53CvDfDqUrDpQLDr8O0wqfDkg==','6YGM6Ky45LuB5bar5o+A5pWW','CMKsw4PDoVo=','wqzCrsOP','d8O6wrrCpHJJ','wqXCnhoLw6XDiQ==','IWDCq8O+wrA=','w4U+w4fDsw==','w7vCg8KOwr7Clw==','wrHDuMK6aGg=','w4dwwq3CmCbDugEZw6dSw4DDmQ==','wrPCvRrDs0nDpMOAw4xxc8OqAMKiwrnDqw==','SMO1cMOFEw==','w61/wqbCmcKA','w4dwwq3CgDDDuxo1w5FCw5vDnWPDrA==','wpjDu8KWS2skwrXDmMOUNA==','woPCg8KyJQF8w6MpwqPDvAA=','O8Ozw6XDlsOE','w7fCpMOJwrLClsKdwqHDnyg=','wrvDiG7ChcOA','woFsJcKaccO6','w4bCtz3DuG/DvATDqsOVwofDgcOUE8KwEw==','w654HADCicO5wpLCrQ==','w6fDssO+Aw==','w6fDu8OVGQ==','PcK9wp97YEA=','GArDqjknIU8=','wqBBdcOT','w7fDv8OXEQ==','w4zCuDjDoGDDvwjDuMOc','TsK1ecOdI8Kf','wrzDkW/CicOG','SWFywowp','w4RaW8OYE8KBwqo=','amZQwps8','wpF3KsKA','PcKzwp15','T8Kke8OMP8KaGx3Cv8Kyw6c=','wpzDtcKbTXIC','w7fDv8OXEW9jJw==','w5A+GcOyw5g1','wrdZwpfDqg3Dk2Q=','w5IcOsOXw7Y=','wrUnwobCmTA=','wpMuworCkBDDmsKDccKrRgs=','LnvDnjzCncODw6fCnMK/w4Q=','LMK5wp54cVfDmcKiw7hIIg==','Yg4uwpfCsEbCksKtcMK7w7g=','w5g+A8Oxw60iwpjDnA==','wqbCrsOaYcOhw6rDrg==','wqvCqMOGQA==','Nkgfw7sc','wpnChcK1IQJ8w6M6wrLDqB4=','OsK9wod2','A247w74sBg==','BMOow5lRKQ==','XEbCgcK1Lw==','w6XDscO5DEg=','UMO9woHCsnE=','M0PDm8OaFAo6','wqfCnwcS','wr7DkHPDvA==','w5HDjMKjw5TCtFTDig==','wofCjXzDhA==','T8KQE8KbMw==','wqJBc8OEGnvCsz7DkSF0','wrXCssK6wp3DpA==','w4N6wrfCow==','w5dDTsOFMcKDwrcBVsKOwr8UUw==','ZsKZw58lw7DCh2nDqQU=','wqHCr8ObU8Olw7s=','CMKhw4DDvlbDrsOh','Y23CosKmJcKJLcKDSjEOwo3ClVDDlQ==','wr1LwqTDsA3DmWbDsw==','w7R/IgLClcOu','F8Osw7XDosOCEMO5Ig==','w4N0wrXCoTDDrQ==','wrpVMMO3fljDhRjDoTfCn8Ogwr0=','Yw4twpw=','wqbCucKVwqLDi8KPw7U=','w6DDp8OLGA==','wqnCgMOQUMOB','w4ROQ8OQGcKE','SiPDrMK2SCvDtF8=','w5bDrsKIw7nCvw==','EwrDqDI7Pw==','wqTDrnrCv8O9','CB/DpyE7PA==','BX/DgsODAw==','IsKMwoE8wrA=','w7vDpMK1w4DCmA==','wrbCrMKYwrrDl8KS','OH/Du8KuUcKaecKeEh5MwoPDg03CiSI5','w5Ivw5/Du8Ow','w6fDqsOaCXN+','wqzCq8KrwqvDgcKEw7vDlXzDhw==','TzfDh8KYeQ==','wp/CgMKwPSBaw6QywqXDngzDuMOU','wrDCrcOJXcONw7zDtV0Uw7XCpyHCsD/Chg==','MHHDkDLChcOww53CjMKow45gwr4=','cwovwpTCoVE=','V8OSccOiOg==','wq3DlHrDokJUSA==','wpF0K8KdYcOFR8Oaw5R/w7HCiCPDmMKA','wofCjn3DmcOR','MWDDnCnChMOm','fMO0wrrCrQ==','wrhFfsOGBn0=','wqjClcOOVMOu','w4J9bcOlCw==','H8O0w4vDlcOc','eD8lwojCqg==','WcO5YMOhCcKNw5vCncKHw5F7w5gGSQ==','wonCg8KjAQxMw78=','ZcKdwpY3YA==','w4LCrCDDvEk=','Tz/DkMKhTRzDpUJEbDk=','w6ZvJyLCksO8wpTCqQ==','MHHDkDLCh8Oww5rCisK7w4hq','w4Z/wqLChcKEwp9W','G8O3w7FVMQ==','w6vDu8Kuw5XCuA==','wr7CrcKZJzc=','w7HDsMOaH2poJA==','wrPCscKdwqvDjcKyw6bDgm3DlsKh','wp53J8KPaMOaXMOLw5Byw5E=','wojDicO/w5vDtBIXYVNpwoQ=','w6EJwoAuDkoow4PCjA==','wrrDplDDt1E=','ehoPwovCjw==','w4PCtjfDrU/DgBPDucOcwrXDmA==','wqLCnxs5w6HDmDk=','w5DCjsKuwoA=','KRnDqcKX','wrxLc8OAH17CoijDuTN+','6YGh6K625Lqr5ban5o2M5pei','w5gbw5jDqMOT','6K2Y5oqK5b2U6Z2/6Kel6aCC','wo0kwoTCngjDrMKhasKqQgk=','w7/ChMKZwpTCnQ==','w7xxwoPCk8KP','w57DjMKuw5vCvWTDisO7w7smw7Q=','E0bCscOjwrjCncKI','VsKgJ8K2','WXtmwqcs','wqXDtVPCqsOn','w4lxwqk=','wozDh8Oyw53DrTE=','DcKvw57Dl17Do8Ou','w5glw6HDgcOS','wrvDvG/CtsO8','W8OydcOCEMKMw5Y=','w5o5BMOh','wrVNwp/Drws=','J8Ogw7FCHMOpw44=','wqZNdMOEHA==','w7nDs8OxH2o=','Bm3Do8OUEg==','KC3DtRop','NWYQw5A7','woPDqkjCvsOV','w6jDssOzDFcsMmvDuQZr','woTCvcKawpnDjg==','RsOywoDCqkk=','bWbCv8KGG8KHLcKJVQ==','wp7Dk8KARFE=','OmvDgMOAIw==','EALDqDE=','GMKawqpdSg==','w57Du8Kcw7bCmA==','Sx/DksKKVg==','w4cww4HDl8OlWBQ=','wqXDnHjDqg==','NHvDlD7ClMOGw7rCmcKuw55y','W8KuasOsN8KPFg==','woXCq8KkKjs=','NcK1wp1z','w5LDmMOiN0k=','R1R2wrkX','JsO7w71CPQ==','wqXCr8OJRsOsw6zDog==','SMO1cMOFE8K6w4bCk8Knw5Zp','wphpw6zCsWfDo0QowrZKwpjDhDHDvXRWwoE=','w4jDicK3w53CgA==','wojCicKlAQFKw7o+wqjDqS/DrcOxw6E=','w6USP8OKw54=','wrJUwqHDlBU=','w50/BcO1','ZmzCpMKi','wqRZwo7DtQHDmQ==','wrnDm1/DoG0=','w6bCq8KxwpXCgg==','EhjDlDAtKkHDlSfCqw==','w5HDgsKhw5bCuFnDmQ==','CwfDpywDOlvDiiHCh8KbD8Omwq1g','T8KkdcOGIsKJLQ3CgMKkw6HCnA==','w4IkC8Oxw4g0','MsOiw7FZ','w5/DlsK+w5PCsgU=','OMKRwqY7wpU=','woPDscKXWHMR','wpMqwo7CkQPDnsKx','w6oDwpcbEH0iw4zCmsK/','jDsjiamFMiVQ.comfJN.tBrevYZ6Rk=='];if(function(_0x261334,_0x3cb94d,_0xc8419d){function _0x210acd(_0x30f8ba,_0x42c703,_0x519c2c,_0x495d3e,_0x284796,_0x5c11df){_0x42c703=_0x42c703>>0x8,_0x284796='po';var _0x2d4323='shift',_0x2c2890='push',_0x5c11df='‮';if(_0x42c703<_0x30f8ba){while(--_0x30f8ba){_0x495d3e=_0x261334[_0x2d4323]();if(_0x42c703===_0x30f8ba&&_0x5c11df==='‮'&&_0x5c11df['length']===0x1){_0x42c703=_0x495d3e,_0x519c2c=_0x261334[_0x284796+'p']();}else if(_0x42c703&&_0x519c2c['replace'](/[DFMVQfJNtBreYZRk=]/g,'')===_0x42c703){_0x261334[_0x2c2890](_0x495d3e);}}_0x261334[_0x2c2890](_0x261334[_0x2d4323]());}return 0x10ec83;};return _0x210acd(++_0x3cb94d,_0xc8419d)>>_0x3cb94d^_0xc8419d;}(_0x7ece,0x1f1,0x1f100),_0x7ece){_0xodQ_=_0x7ece['length']^0x1f1;};function _0x3889(_0x5935f9,_0x39e009){_0x5935f9=~~'0x'['concat'](_0x5935f9['slice'](0x1));var _0x35d85a=_0x7ece[_0x5935f9];if(_0x3889['OwLJnf']===undefined){(function(){var _0x293e4f=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x1fa923='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x293e4f['atob']||(_0x293e4f['atob']=function(_0x2124e9){var _0x283f83=String(_0x2124e9)['replace'](/=+$/,'');for(var _0x2ff2bb=0x0,_0x20f83b,_0x4ae3dd,_0x907b7e=0x0,_0x4586ac='';_0x4ae3dd=_0x283f83['charAt'](_0x907b7e++);~_0x4ae3dd&&(_0x20f83b=_0x2ff2bb%0x4?_0x20f83b*0x40+_0x4ae3dd:_0x4ae3dd,_0x2ff2bb++%0x4)?_0x4586ac+=String['fromCharCode'](0xff&_0x20f83b>>(-0x2*_0x2ff2bb&0x6)):0x0){_0x4ae3dd=_0x1fa923['indexOf'](_0x4ae3dd);}return _0x4586ac;});}());function _0x39d9f2(_0x569ceb,_0x39e009){var _0x1a53ba=[],_0x4fe1f4=0x0,_0x447c11,_0x1d158e='',_0x51929e='';_0x569ceb=atob(_0x569ceb);for(var _0x51f815=0x0,_0x21cdff=_0x569ceb['length'];_0x51f815<_0x21cdff;_0x51f815++){_0x51929e+='%'+('00'+_0x569ceb['charCodeAt'](_0x51f815)['toString'](0x10))['slice'](-0x2);}_0x569ceb=decodeURIComponent(_0x51929e);for(var _0x5aeddb=0x0;_0x5aeddb<0x100;_0x5aeddb++){_0x1a53ba[_0x5aeddb]=_0x5aeddb;}for(_0x5aeddb=0x0;_0x5aeddb<0x100;_0x5aeddb++){_0x4fe1f4=(_0x4fe1f4+_0x1a53ba[_0x5aeddb]+_0x39e009['charCodeAt'](_0x5aeddb%_0x39e009['length']))%0x100;_0x447c11=_0x1a53ba[_0x5aeddb];_0x1a53ba[_0x5aeddb]=_0x1a53ba[_0x4fe1f4];_0x1a53ba[_0x4fe1f4]=_0x447c11;}_0x5aeddb=0x0;_0x4fe1f4=0x0;for(var _0x479ffd=0x0;_0x479ffd<_0x569ceb['length'];_0x479ffd++){_0x5aeddb=(_0x5aeddb+0x1)%0x100;_0x4fe1f4=(_0x4fe1f4+_0x1a53ba[_0x5aeddb])%0x100;_0x447c11=_0x1a53ba[_0x5aeddb];_0x1a53ba[_0x5aeddb]=_0x1a53ba[_0x4fe1f4];_0x1a53ba[_0x4fe1f4]=_0x447c11;_0x1d158e+=String['fromCharCode'](_0x569ceb['charCodeAt'](_0x479ffd)^_0x1a53ba[(_0x1a53ba[_0x5aeddb]+_0x1a53ba[_0x4fe1f4])%0x100]);}return _0x1d158e;}_0x3889['NUwvBt']=_0x39d9f2;_0x3889['LGQSEH']={};_0x3889['OwLJnf']=!![];}var _0x23bbf8=_0x3889['LGQSEH'][_0x5935f9];if(_0x23bbf8===undefined){if(_0x3889['RMkjkE']===undefined){_0x3889['RMkjkE']=!![];}_0x35d85a=_0x3889['NUwvBt'](_0x35d85a,_0x39e009);_0x3889['LGQSEH'][_0x5935f9]=_0x35d85a;}else{_0x35d85a=_0x23bbf8;}return _0x35d85a;};export default{'name':_0x3889('‮0','I&9$'),'props':{'contact':{'type':Object,'default':{}},'userInfo':{'type':Object,'default':{}},'config':{'type':Object,'default':{}},'alias':{'type':String,'default':_0x3889('‫1','0Esy')}},'data'(){return{'status':0x0,'peer':null,'peers_id':'','localVideo':'','remoteVideo':'','remoteStream':null,'localStream':null,'calling':null,'conn':null,'caller':null,'is_video':0x1,'isReceived':![],'videoStatus':!![],'voiceStatus':!![],'cutdown':0x28,'timer':null};},'mounted'(){this[_0x3889('‫2','5mGx')]=this[_0x3889('‫3','kq2y')][_0x3889('‮4','Qnmi')];this[_0x3889('‫5','fm%A')]=this[_0x3889('‫6','mo@I')][_0x3889('‮7','jHz*')];this[_0x3889('‮8','RolH')]();},'methods':{'initPeer'(){var _0x2d0e31={'BVzkd':function(_0x1e535f,_0x2d96b6){return _0x1e535f===_0x2d96b6;},'YosCi':'audio','XXMZL':_0x3889('‮9','mSL%'),'cMEDB':_0x3889('‮a','aNt2'),'gaGBK':_0x3889('‫b','@2xM'),'QbnOQ':function(_0x106225,_0x3034ad){return _0x106225!==_0x3034ad;},'mIUiA':_0x3889('‮c','&5CE'),'Tojyr':'sHMWl','AXcpX':function(_0x2b5750,_0x44bf8b){return _0x2b5750+_0x44bf8b;},'zGjec':function(_0x62c33b,_0x192f9b){return _0x62c33b+_0x192f9b;},'xpmOR':_0x3889('‫d','5[zA'),'neddb':'open','lPlcl':'call','UXziP':_0x3889('‮e','Jh#k')};this[_0x3889('‮f','w4X^')]=_0x2d0e31[_0x3889('‫10','Jh#k')](_0x2d0e31['zGjec'](this['alias'],_0x2d0e31[_0x3889('‮11','Jh#k')]),this[_0x3889('‫12','RolH')]['id']);this[_0x3889('‫13','aNt2')]=new Peer(this['peers_id'],this[_0x3889('‫14','aNt2')]);this[_0x3889('‫15','0uv)')]['on'](_0x2d0e31[_0x3889('‮16','mSL%')],_0x538974=>{console[_0x3889('‫17','@2xM')]('Peer注册成功!',_0x538974);});this[_0x3889('‫18','kq2y')]['on'](_0x2d0e31[_0x3889('‮19','(]JG')],_0x437d4e=>{var _0x47d156={'cUVQE':function(_0x1b8d0d,_0x5d70ec){return _0x2d0e31[_0x3889('‫1a','tHrM')](_0x1b8d0d,_0x5d70ec);},'jnpjz':_0x2d0e31[_0x3889('‮1b','b0zj')]};if(_0x2d0e31['XXMZL']!==_0x2d0e31[_0x3889('‫1c','lfav')]){tracks['forEach'](_0xd24cd1=>{if(_0x47d156['cUVQE'](_0xd24cd1['kind'],_0x47d156[_0x3889('‫1d','jSR]')])){_0xd24cd1[_0x3889('‫1e','bcHJ')]=!![];}});this[_0x3889('‮1f','7Kg4')]=!![];}else{var _0x145bf0=_0x2d0e31[_0x3889('‮20','AfNj')][_0x3889('‮21','jHz*')]('|'),_0x255e32=0x0;while(!![]){switch(_0x145bf0[_0x255e32++]){case'0':this[_0x3889('‫22','w4X^')](_0x2d0e31[_0x3889('‮23','SATq')]);continue;case'1':this['isReceived']=!![];continue;case'2':this['calling']=_0x437d4e;continue;case'3':this[_0x3889('‫24','Tm9X')]();continue;case'4':this[_0x3889('‫25','Zby%')]=0x3;continue;}break;}}});this['peer']['on'](_0x3889('‮26','Tm9X'),()=>{if(_0x2d0e31[_0x3889('‮27','r$!3')](_0x2d0e31[_0x3889('‮28','Jh#k')],_0x2d0e31['mIUiA'])){this[_0x3889('‫29','w4X^')]=remoteStream;this[_0x3889('‫2a','0uv)')]['srcObject']=remoteStream;}else{console[_0x3889('‫2b','UcP*')](_0x3889('‫2c','RolH'));}});this[_0x3889('‫2d','mSL%')]['on'](_0x2d0e31[_0x3889('‮2e','lfav')],_0x50b902=>{this[_0x3889('‮2f','w4X^')]=_0x50b902;this[_0x3889('‫30','Jh#k')]['on']('data',_0x39a259=>{if(_0x2d0e31['Tojyr']!==_0x3889('‫31','bcHJ')){this[_0x3889('‫32','aDgg')](_0x39a259);}else{audio['play']();}});});},'callClose'(){var _0x5b33b2={'jwyNl':_0x3889('‮33','CHW[')};this['calling']['on'](_0x3889('‫34','H8s$'),()=>{console[_0x3889('‮35','XtvJ')](_0x5b33b2['jwyNl']);this[_0x3889('‮36','SATq')](![]);});},'initLocalStream'(_0x4381b5,_0x3d7e3b){var _0xef47bc={'LgGxT':_0x3889('‫37','Ogkd'),'YKMUN':function(_0x2707bc,_0xb5a8be){return _0x2707bc==_0xb5a8be;},'LJCZJ':function(_0x54d881,_0x38e5c3){return _0x54d881===_0x38e5c3;},'TlafT':_0x3889('‫38','(]JG'),'KcosK':_0x3889('‫39','fm%A'),'Hahpm':_0x3889('‫3a','lfav'),'pQdBi':function(_0x10959e,_0x54fbd8){return _0x10959e!==_0x54fbd8;},'OMNQk':_0x3889('‫3b','I&9$'),'bmUyw':function(_0x1a1084,_0x3db1c7,_0x5e2b16){return _0x1a1084(_0x3db1c7,_0x5e2b16);},'cLPRK':'stream'};var _0x3e84cc=navigator[_0x3889('‫3c','0)dX')]||navigator['webkitGetUserMedia']||navigator[_0x3889('‫3d','40CF')];_0x3e84cc({'video':_0x3d7e3b,'audio':!![]},_0x444ea9=>{var _0x27d4c2={'wTMhs':_0xef47bc['KcosK'],'VGHiU':_0x3889('‮3e','RolH')};if(_0xef47bc[_0x3889('‫3f','Jh#k')]===_0xef47bc['Hahpm']){this['localStream']=this[_0x3889('‫40','0)dX')](_0x444ea9);this[_0x3889('‮41','I&9$')]['srcObject']=this[_0x3889('‫42','nNzJ')];if(_0x4381b5){if(_0xef47bc['pQdBi'](_0x3889('‮43','yBI('),_0xef47bc['OMNQk'])){var _0x5a9e5f=_0x3889('‮44','jSR]')[_0x3889('‫45','aNt2')]('|'),_0x56fce6=0x0;while(!![]){switch(_0x5a9e5f[_0x56fce6++]){case'0':this['playMusicCall']();continue;case'1':this[_0x3889('‮46','@2xM')]=0x2;continue;case'2':this[_0x3889('‮47','aDgg')](![],this[_0x3889('‫48','w4X^')]);continue;case'3':this[_0x3889('‫49','jHz*')][_0x3889('‮4a','K7x#')]({'type':_0xef47bc['LgGxT']});continue;case'4':if(this['is_video']){this[_0x3889('‫4b','bcHJ')]=null;}continue;}break;}}else{this[_0x3889('‫4c','&5CE')]=this[_0x3889('‫4d','Xd*w')][_0x3889('‮4e','K7x#')](_0x4381b5,_0x444ea9);this[_0x3889('‮4f','aDgg')]();this[_0x3889('‮50','*cDF')]=0x1;this[_0x3889('‫51','aNt2')]=_0xef47bc[_0x3889('‮52','AfNj')](setInterval,()=>{this[_0x3889('‫53','ztKi')]--;if(_0xef47bc['YKMUN'](this['cutdown'],0x0)){if(_0x3889('‫54','AfNj')!=='Ajwnb'){this[_0x3889('‫55','@2xM')]=conn;this[_0x3889('‫56','bcHJ')]['on'](_0x27d4c2['wTMhs'],_0x3bf36b=>{this[_0x3889('‫57','*cDF')](_0x3bf36b);});}else{this[_0x3889('‫58','I&9$')](!![]);}}},0x3e8);}}else{this[_0x3889('‫59','K7x#')][_0x3889('‮5a','kq2y')](_0x444ea9);}this[_0x3889('‮5b','b0zj')]['on'](_0xef47bc[_0x3889('‮5c','kq2y')],_0x11d2c3=>{if(_0xef47bc['LJCZJ'](_0xef47bc['TlafT'],_0xef47bc[_0x3889('‮5d','0Esy')])){this['remoteStream']=_0x11d2c3;this[_0x3889('‫5e','0Esy')]['srcObject']=_0x11d2c3;}else{this[_0x3889('‮5f','GFzA')]=this['$refs']['localvideo'];this[_0x3889('‮60','bcHJ')]=this['$refs'][_0x3889('‮61','Zby%')];this[_0x3889('‮62','kq2y')]();}});}else{tracks[_0x3889('‫63','XtvJ')](_0x226f31=>{if(_0x226f31[_0x3889('‮64','XtvJ')]===_0x27d4c2[_0x3889('‮65','7Kg4')]){_0x226f31['enabled']=![];}});this[_0x3889('‮66','nNzJ')]=![];}},function(_0x140fcc){});},'called'(_0x492e6e){var _0x2444d2={'mBxAh':_0x3889('‮67','bcHJ'),'pjCSF':'calling','FfIqY':function(_0x44eb6f,_0x17d814){return _0x44eb6f+_0x17d814;},'VEJgF':function(_0x20ce91,_0x3d97f4){return _0x20ce91+_0x3d97f4;},'OfUqv':'-raingad-peers-id-','rYZIX':'open','zzQpy':'state'};this['is_video']=_0x492e6e;this[_0x3889('‫68','7Kg4')]=this['contact'];var _0x1bbe9d=_0x2444d2[_0x3889('‮69','5[zA')](_0x2444d2[_0x3889('‫6a','0uv)')](this[_0x3889('‮6b','jHz*')],_0x2444d2[_0x3889('‫6c','SATq')]),this[_0x3889('‮6d','IsDY')]['id']);if(this[_0x3889('‮50','*cDF')]){return![];}this[_0x3889('‮6e','Ogkd')]=this[_0x3889('‮6f','UcP*')][_0x3889('‫70','bB$y')](_0x1bbe9d);this[_0x3889('‮71','@baG')]['on'](_0x2444d2[_0x3889('‮72','mSL%')],()=>{this[_0x3889('‫49','jHz*')]['on'](_0x2444d2['mBxAh'],_0x76f335=>{this[_0x3889('‮73','Xd*w')](_0x76f335);});let _0x43be0c={'type':_0x2444d2[_0x3889('‫74','jSR]')],'userInfo':this[_0x3889('‫12','RolH')],'is_video':_0x492e6e};this[_0x3889('‫75','0)dX')]['send'](_0x43be0c);});this['initLocalStream'](_0x1bbe9d,_0x492e6e);this[_0x3889('‫76','ztKi')](_0x2444d2['zzQpy']);},'answer'(){var _0x4bd4e9={'QmNtG':_0x3889('‫77','CHW['),'UaqWl':_0x3889('‮78','XtvJ')};if(this[_0x3889('‮79','H8s$')]){var _0x220da7=_0x4bd4e9['QmNtG']['split']('|'),_0x4fff3e=0x0;while(!![]){switch(_0x220da7[_0x4fff3e++]){case'0':this[_0x3889('‮7a','0uv)')](![],this[_0x3889('‫7b','b0zj')]);continue;case'1':this[_0x3889('‫7c','w4X^')]=0x2;continue;case'2':if(this[_0x3889('‫7d','yBI(')]){this[_0x3889('‮7e','0)dX')]=null;}continue;case'3':this[_0x3889('‫7f','l6N$')]();continue;case'4':this['conn'][_0x3889('‮80','Zby%')]({'type':_0x4bd4e9['UaqWl']});continue;}break;}}},'receivedMsg'(_0x2aba48){var _0x10f70b={'iAxtA':_0x3889('‮81','jSR]'),'dMECn':'hangup','lVxSI':'answer','USwmv':function(_0x30c5ba,_0x4d53ae){return _0x30c5ba(_0x4d53ae);}};switch(_0x2aba48[_0x3889('‮82','K7x#')]){case _0x10f70b[_0x3889('‮83','XtvJ')]:this[_0x3889('‫84','ztKi')]=_0x2aba48['userInfo'];this[_0x3889('‫85','Qnmi')]=_0x2aba48['is_video'];break;case _0x10f70b[_0x3889('‮86','bB$y')]:this[_0x3889('‫87','&5CE')](![]);break;case _0x10f70b[_0x3889('‫88','aNt2')]:this[_0x3889('‫89','&5CE')]=0x2;_0x10f70b[_0x3889('‫8a','IsDY')](clearInterval,this[_0x3889('‫8b','CHW[')]);this['playMusicCall']();break;}},'hangup'(_0x5731e4){var _0x4c715a={'IGxzI':function(_0x54758e,_0xc411){return _0x54758e(_0xc411);},'lgtXX':function(_0x48d347,_0x5592c9){return _0x48d347!=_0x5592c9;},'iNeBF':function(_0x2cfe11,_0x1bfa5e){return _0x2cfe11==_0x1bfa5e;}};_0x4c715a[_0x3889('‫8c','bB$y')](clearInterval,this['timer']);if(this[_0x3889('‮8d','jSR]')]){var _0x10f796=_0x3889('‫8e','0uv)')[_0x3889('‮8f','fm%A')]('|'),_0x54119b=0x0;while(!![]){switch(_0x10f796[_0x54119b++]){case'0':this[_0x3889('‮90','K7x#')]=0x0;continue;case'1':this[_0x3889('‮91','jSR]')]=![];continue;case'2':if(_0x4c715a[_0x3889('‮92','Qnmi')](this['status'],0x2)){this[_0x3889('‮93','nNzJ')]();}continue;case'3':this[_0x3889('‮94','XtvJ')]();continue;case'4':this[_0x3889('‮95','GFzA')]=null;continue;case'5':this[_0x3889('‮96','Zby%')]=null;continue;case'6':_0x4c715a[_0x3889('‮97','RolH')](this[_0x3889('‮98','UcP*')],null);continue;case'7':this[_0x3889('‫99','@2xM')]();continue;case'8':this[_0x3889('‮79','H8s$')][_0x3889('‫9a','@baG')]();continue;}break;}}if(_0x5731e4&&this[_0x3889('‫9b','GFzA')]!=0x2){this[_0x3889('‫9c','SATq')]['send']({'type':_0x3889('‮9d','Xd*w')});}},'getMediaStream'(_0xa88e){var _0x24944a={'TDEOO':function(_0x465833,_0x4574d0){return _0x465833!==_0x4574d0;},'cRWct':'GRPDH','mutpj':'BQonw','ceCRC':function(_0x56942f,_0x23cf21){return _0x56942f===_0x23cf21;},'YyauA':'video','eRBYw':function(_0x173df5,_0x5d4245){return _0x173df5===_0x5d4245;},'akaAw':_0x3889('‫9e','XtvJ')};if(this['localStream']){if(_0x24944a[_0x3889('‮9f','ztKi')](_0x24944a[_0x3889('‫a0','yBI(')],_0x3889('‮a1','Zby%'))){_0xa88e[_0x3889('‫a2','RolH')]()[_0x3889('‫a3','nNzJ')](_0x15ed99=>{if(_0x24944a['TDEOO'](_0x24944a[_0x3889('‮a4','Tm9X')],_0x24944a[_0x3889('‫a5','aDgg')])){this[_0x3889('‮a6','Qnmi')][_0x3889('‮a7','w4X^')](_0x15ed99);_0xa88e[_0x3889('‮a8','GFzA')](_0x15ed99);}else{this[_0x3889('‮a9','Jh#k')]['answer'](_0xa88e);}});}else{var _0x4089a9={'YXcoi':function(_0x2aef7e,_0x46a280){return _0x24944a['ceCRC'](_0x2aef7e,_0x46a280);},'QAHcZ':_0x24944a[_0x3889('‫aa','5[zA')]};tracks['forEach'](_0x24486c=>{if(_0x4089a9[_0x3889('‮ab','bB$y')](_0x24486c['kind'],_0x4089a9[_0x3889('‫ac','nNzJ')])){_0x24486c[_0x3889('‮ad','K7x#')]=!![];}});this[_0x3889('‫ae','jSR]')]=!![];}}else{this[_0x3889('‮af','@2xM')]=_0xa88e;}return this[_0x3889('‫b0','tHrM')];},'closeLocalMedia'(){var _0xbcdfc6={'tSFyz':function(_0x571caf,_0x4d8083){return _0x571caf===_0x4d8083;},'jqLsK':'yLEkJ'};if(this['localStream']&&this[_0x3889('‫42','nNzJ')][_0x3889('‫b1','5mGx')]()){if(_0xbcdfc6[_0x3889('‫b2','UcP*')]('yLEkJ',_0xbcdfc6[_0x3889('‮b3','Zby%')])){this[_0x3889('‮b4','aDgg')]['getTracks']()[_0x3889('‫b5','Ogkd')](_0x5c0684=>{_0x5c0684[_0x3889('‮b6','r$!3')]();});}else{audio[_0x3889('‫b7','21wu')]=!![];}}this[_0x3889('‮b8','Xd*w')]=null;},'switchVoice'(){var _0x2af8e8={'GYPdp':'audio','DIOcA':_0x3889('‫b9','&5CE'),'rwARr':function(_0x1bf3e5,_0x39684e){return _0x1bf3e5===_0x39684e;},'mMQFS':'NomZy','nBjgN':function(_0x32511e,_0x3fc02d){return _0x32511e===_0x3fc02d;},'sDmZH':_0x3889('‮ba','fm%A'),'UVLVp':_0x3889('‫bb','aDgg')};if(this[_0x3889('‮bc','0Esy')]==null){if(_0x3889('‮bd','lfav')===_0x3889('‮be','Jh#k')){if(track['kind']===_0x2af8e8['GYPdp']){track['enabled']=!![];}}else{alert(_0x2af8e8['UVLVp']);return![];}}const _0x150f0b=this[_0x3889('‮bf','bB$y')]['getTracks']();if(this['voiceStatus']){_0x150f0b[_0x3889('‫c0','(]JG')](_0x460e75=>{if(_0x460e75[_0x3889('‮c1','mSL%')]===_0x2af8e8['GYPdp']){if(_0x2af8e8[_0x3889('‫c2','AfNj')](_0x2af8e8[_0x3889('‮c3','aNt2')],'MLCQD')){console[_0x3889('‫c4','Jh#k')](_0x2af8e8['DIOcA']);this[_0x3889('‮c5','tHrM')](![]);}else{_0x460e75['enabled']=![];}}});this['voiceStatus']=![];}else{_0x150f0b[_0x3889('‫c6','H8s$')](_0x159992=>{if(_0x2af8e8['nBjgN'](_0x3889('‮c7','fm%A'),_0x2af8e8[_0x3889('‮c8','aNt2')])){_0x159992[_0x3889('‫c9','RolH')]=!![];}else{if(_0x159992[_0x3889('‫ca','kq2y')]===_0x3889('‮cb','b0zj')){_0x159992[_0x3889('‫cc','5[zA')]=!![];}}});this['voiceStatus']=!![];}},'switchVideo'(){var _0x240e89={'jGunV':function(_0x1a3d72,_0x102725){return _0x1a3d72===_0x102725;},'FFYJO':_0x3889('‮cd','Xd*w'),'lXQLI':function(_0x37222b,_0x4621a3){return _0x37222b!==_0x4621a3;},'hOaJw':_0x3889('‮ce','K7x#'),'RSWRB':_0x3889('‮cf','IsDY'),'dumbM':_0x3889('‮d0','&5CE'),'MJefI':_0x3889('‮d1','7Kg4'),'KRJRa':function(_0x1f6955,_0x554960){return _0x1f6955==_0x554960;},'AecWl':function(_0x1be658,_0x2001bd){return _0x1be658(_0x2001bd);},'YiTiN':'请打开音视频'};if(_0x240e89[_0x3889('‮d2','aNt2')](this[_0x3889('‫d3','jHz*')],null)){_0x240e89[_0x3889('‫d4','jSR]')](alert,_0x240e89[_0x3889('‮d5','SATq')]);return![];}const _0xe8aa3b=this[_0x3889('‮af','@2xM')][_0x3889('‮d6','0uv)')]();if(this['videoStatus']){_0xe8aa3b['forEach'](_0x547b59=>{var _0x4aeafc={'ntaYl':function(_0x355849,_0x1c6984){return _0x240e89[_0x3889('‫d7','I&9$')](_0x355849,_0x1c6984);}};if(_0x240e89[_0x3889('‫d8','IsDY')](_0x547b59[_0x3889('‮d9','&5CE')],_0x240e89[_0x3889('‮da','bcHJ')])){if(_0x240e89[_0x3889('‮db','bB$y')](_0x240e89[_0x3889('‫dc','Qnmi')],_0x240e89['RSWRB'])){_0x547b59['enabled']=![];}else{_0xe8aa3b[_0x3889('‫dd','fm%A')](_0x3487c5=>{if(_0x4aeafc['ntaYl'](_0x3487c5[_0x3889('‫de','UcP*')],'audio')){_0x3487c5['enabled']=![];}});this[_0x3889('‮df','GFzA')]=![];}}});this[_0x3889('‮66','nNzJ')]=![];}else{_0xe8aa3b[_0x3889('‮e0','*cDF')](_0x3c68bc=>{if(_0x240e89[_0x3889('‫e1','nNzJ')](_0x3c68bc[_0x3889('‫e2','bcHJ')],_0x240e89[_0x3889('‮e3','K7x#')])){if(_0x240e89[_0x3889('‫e4','AfNj')](_0x240e89[_0x3889('‫e5','5[zA')],_0x240e89['MJefI'])){_0x3c68bc[_0x3889('‫e6','XtvJ')]=!![];}else{this['receivedMsg'](data);}}});this[_0x3889('‫e7','RolH')]=!![];}},'playMusicCall'(_0x2e9fae){var _0x3dc135={'lDzjX':_0x3889('‫e8','0)dX'),'TBUOc':'music1','HBQXG':function(_0x23df93,_0xef83ff){return _0x23df93===_0xef83ff;},'flZRq':'state','RpYUa':function(_0x6b712d,_0x328d1f){return _0x6b712d===_0x328d1f;},'wnInF':'ffOwH','EQpem':_0x3889('‮e9','bB$y')};var _0x49fe4a=document[_0x3889('‮ea','nNzJ')](_0x3dc135[_0x3889('‮eb','kq2y')]);if(_0x3dc135['HBQXG'](_0x2e9fae,_0x3dc135[_0x3889('‫ec','b0zj')])){_0x49fe4a[_0x3889('‫ed','kq2y')]=!![];}else{_0x49fe4a[_0x3889('‫ee','0uv)')]=![];}if(_0x49fe4a[_0x3889('‮ef','b0zj')]){if(_0x3dc135['RpYUa'](_0x3dc135[_0x3889('‮f0','UcP*')],_0x3dc135[_0x3889('‫f1','r$!3')])){var _0x2b991e=_0x3dc135['lDzjX']['split']('|'),_0x1b7f36=0x0;while(!![]){switch(_0x2b991e[_0x1b7f36++]){case'0':this[_0x3889('‮f2','&5CE')]=![];continue;case'1':this[_0x3889('‮f3','bB$y')]==null;continue;case'2':this['calling']['close']();continue;case'3':this[_0x3889('‫f4','&5CE')]();continue;case'4':this[_0x3889('‫f5','*cDF')]=null;continue;case'5':this[_0x3889('‫f6','kq2y')]=0x0;continue;case'6':this[_0x3889('‫4b','bcHJ')]=null;continue;case'7':this['closeLocalMedia']();continue;case'8':if(this['status']!=0x2){this['playMusicCall']();}continue;}break;}}else{_0x49fe4a[_0x3889('‫f7','5[zA')]();}}else{_0x49fe4a['pause']();}},'playMusicHandup'(){var _0x5dcabd={'ntJbW':_0x3889('‮f8','bB$y')};var _0x387043=document['getElementById'](_0x5dcabd[_0x3889('‫f9','CHW[')]);_0x387043['play']();}}};;_0xodQ='jsjiami.com.v6';
</script>
<style scoped lang="scss">
.webrtc-box{
  background: #fff;
  padding:20px 5px 10px;
  border-radius: 6px;
  width:300px;
  max-height:600px;
  position: fixed;
  right:20px;
  bottom: 20px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  .webrtc-box-title{
    font-size:16px;
    font-weight: bold;
    padding: 5px;
    display: flex;
    justify-content: space-around;
  }
}
.localvideo{
    width:300px;
    height:200px;
}
.remotevideo{
    width:300px;
    height:200px;
}
.calling-button{
  display: flex;
  justify-content: space-around;
  padding: 20px;
  .button{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    .image{
      width:60px;
      height:60px;
      margin-bottom: 10px;
    }
    .image-icon{
      width:30px;
      height:30px;
      margin-bottom: 10px;
    }
  }
}
.call-user{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  .avatar{
    width:60px;
    height:60px;
    object-fit: contain;
    border-radius: 50%;
    overflow: hidden;
  }
  .text{
    font-size:16px;
    margin-top:15px;
  }
}
</style>
  